<template>
  <div>
    <index-header></index-header>
    <index-data></index-data>
    <index-sports></index-sports>
    <index-sleep></index-sleep>
    <index-area :classList="classList"></index-area>
    <index-notes :classList="classList"></index-notes>
  </div>
</template>

<script>
import IndexHeader from "./indexHeader.vue";
import IndexData from "./indexData.vue";
import indexSports from "./indexSports.vue";
import IndexSleep from "./indexSleep.vue";
import IndexArea from "./indexArea.vue";
import IndexNotes from "./indexNotes.vue";
import { skClassList } from '@/api/management.js'
export default {
  name: 'Analysis',
  components: {
    IndexHeader,
    IndexData,
    indexSports,
    IndexSleep,
    IndexArea,
    IndexNotes
  },
  data() {
    return {
      classList:[]
    }
  },
  computed:{
    
  },
  created() {
    this.getClassData()
  },
  methods: {
    getClassData(){
      skClassList()
        .then(res => {
          if (res.success) {
            res.result.forEach(item=>{
              this.classList.push(item.className)
            });
          } else {
            this.$message.warning(res.message)
          }
        })
        .catch(error => {
          console.error(error)
        })
    },  
  }
}
</script>
